<?xml version="1.0" encoding="windows-1255" ?>
<%@ page language="java" contentType="text/html; charset=windows-1255"
    pageEncoding="windows-1255"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%@page import="dataBase.magaers.UserDBMngr"%><html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />
		<title>Insert your code</title>
	</head>
	<body>
<%  if (session.getAttribute("email") == null){ %>
		<jsp:forward page="login.jsp?valid=unsigned" />
<%	} %>
	    <script type="text/javascript" >
	    function validUpload(form){
	    	if (form.title.value == ""){
	    		alert("title cannot be blank");
	    		return false;				
	    	}
	    	if (form.language.value == ""){
	    		alert("language cannot be blank");
	    		return false;				
	    	}
	    	if (form.code.value == ""){
	    		alert("code cannot be blank");
	    		return false;				
	    	}
	    	return true;
	    }
	    </script>
	    <h2>Hello <% out.print(session.getAttribute("email")); %>, fill in the details and send. </h2>
		<form method="post" action="../upload" onsubmit="return validUpload(this)">
		    <fieldset>
		        <legend>title</legend>
			    <table>
				    <tr>
					    <td><label>Code title:</label></td>
					    <td><input name="title" type="text" /></td>
						<td class="required"><font color="red">*</font></td>
					    <td><label>If title already exists will be created as a new version.</label></td>
				    </tr>
				    <tr>
					    <td><label>Language:</label></td>
					    <td><input name="language" type="text" /></td>
					 	<td class="required"><font color="red">*</font></td>   
				    </tr>
			    </table>
		    </fieldset>
		    <fieldset>
		    	<legend>categories</legend>
			    <table>
			    	<tr>
			    		<td><input type="text" name="category0"></input></td>
			    		<td><input type="text" name="category1"></input></td>
			    		<td><input type="text" name="category2"></input></td>
			    	</tr>
			    	<tr>
			    		<td><input type="text" name="category3"></input></td>
			    		<td><input type="text" name="category4"></input></td>
			    		<td><input type="text" name="category5"></input></td>
			    	</tr>
			    </table>
		    </fieldset>
		    <fieldset>
                <legend>code</legend>
		        <table>
		        	<tr><td>
		        	<textarea value="Enter code here..." onblur="if(this.value=='') this.value='Enter code here...';" onfocus="if(this.value=='Enter code here...') this.value='';"  name="code" cols="40" rows="10" ></textarea>
					</td>
					<td class="required" valign="top" ><font color="red" >*</font></td></tr>
					<tr>
						<td>Code visible only for administrator
						<input align="left" type="checkbox" name="visiblity" /></td>
					</tr>
				</table>
            </fieldset>
            <input value="Save" type="submit"></input>
        </form>
	</body>
</html>